<link rel="stylesheet" type="text/css" href="public/kindeditor/themes/default/default.css" />
<script src="public/kindeditor/kindeditor.js" type="text/javascript"></script>
<script src="public/kindeditor/lang/zh_CN.js" type="text/javascript"></script>

<form method="post" id="editForm" name="editForm">
<input type="hidden" name="id" value="${(po.id)!}" id="poid">
<table class="tableForm tableCss">
    <tr>
        <th>单位名称：</th>
        <td colspan="3">
            <input class="easyui-combotree" name="dep_id" id="dep_id" value="${(po.dep_id!)!}" data-options="url:'admin/department/combotree',method:'get',required:true" style="width:200px;">
        </td>
    </tr>
    <tr>
        <th>年级：</th>
        <td>
            <input class="easyui-combobox" name="grade" id="grade"  value="${(po.grade!)!}"   data-options="valueField:'id',textField:'text',url:'admin/class/get_year',onSelect:on_set_class">
        </td>
        <th>专业：</th>
        <td>
            <input class="easyui-textbox" type="text"  id="specialized" name="specialized" value="${(po.specialized!)!}" data-options="required:true,onChange:on_set_class">
        </td>
    </tr>
    <tr>
        <th>班序：</th>
        <td>
            <input class="easyui-numberspinner" type="text" id="class_num" name="class_num" value="${(po.class_num!)!}" data-options="onChange:on_set_class">
        </td>
        <th>三级组织名称：</th>
        <td>
            <input class="easyui-textbox" type="text" id="class_name_id" name="class_name" value="${(po.class_name!)!}" data-options="readonly:true">
        </td>
    </tr>
    <tr>
        <th>班主任：</th>
        <td colspan="3">
            <select class="easyui-combogrid" id="teacher_id" name="teacher_id" value="${(po.teacher_id!)!}" style="width: 150px;"></select>
        </td>
    </tr>
    <tr>
        <th>班干部：</th>
        <td>
            <input class="easyui-textbox" type="text" name="class_cadre_1" value="${(po.class_cadre_1!)!}" >
        </td>
        <th>联系电话：</th>
        <td>
            <input class="easyui-textbox" type="text" name="cadre_tel_phone_1" value="${(po.cadre_tel_phone_1!)!}">
        </td>
    </tr>
    <tr>
        <th>班干部：</th>
        <td>
            <input class="easyui-textbox" type="text" name="class_cadre_2" value="${(po.class_cadre_2!)!}" >
        </td>
        <th>联系电话：</th>
        <td>
            <input class="easyui-textbox" type="text" name="cadre_tel_phone_2" value="${(po.cadre_tel_phone_2!)!}">
        </td>
    </tr>
    <tr>
        <th>班干部：</th>
        <td>
            <input class="easyui-textbox" type="text" name="class_cadre_3" value="${(po.class_cadre_3!)!}" >
        </td>
        <th>联系电话：</th>
        <td>
            <input class="easyui-textbox" type="text" name="cadre_tel_phone_3" value="${(po.cadre_tel_phone_3!)!}">
        </td>
    </tr>
    <tr>
        <th colspan="4" style="text-align: center">简介</th>
    </tr>
    <tr>
        <td colspan="4">
            <textarea name="memo" id="memo" style="width:100%;height: 300px;">${(po.memo!)!}</textarea>
        </td>
    </tr>
</table>
</form>
<script>
    $(function(){
        $("#teacher_id").combogrid({
            panelWidth:450,
            idField:'id',
            textField:'name',
            value:"${(po.teacher_id!)!}",
            url:'admin/user/listTeacherJson',
            pagination:"true",
            pagesize:"50",
            columns:[[
                {field:'id',title:'ID',width:60},
                {field:'name',title:'名称',width:100},
                {field:'phone',title:'联系方式',width:120},
                {field:'email',title:'邮箱',width:100}
            ]]
        });

        // 打开Dialog后创建编辑器
        content=KindEditor.create('textarea[name="memo"]', {
            resizeType : 1
        });
    });

    function on_set_class(){
        var grade = $("#grade").combobox("getValue");
        var specialized = $("#specialized").textbox("getValue");
        var class_num = $("#class_num").numberspinner("getValue");
        if(grade != ""){
            grade +="级 ";
        }
        if(class_num != ""){
            class_num +="班";
        }

        $("#class_name_id").textbox("setValue",grade+specialized+class_num);

    }
</script>
